<!--<?php
print <<<EOT
-->
<div class="m"></div>
<!--
EOT;
if(!$action){
print <<<EOT
-->
<div class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="head">
    <td colspan="8">$cname  </td>
    </tr>
  <tr class="tr2">
    <td width="3%">&nbsp;</td>
    <td>cid</td>
    <td>目录名</td>
    <td>{$very[contentName]}模型</td>
    <td>子目录</td>
    <td>{$very[contentName]}总数</td>
    <td>待发布{$very[contentName]}</td>
    <td>目录{$very[contentName]}操作</td>
  </tr>
<!--
EOT;
foreach($category as $value){
!$value[module] && $value[module]='外部链接';
print <<<EOT
-->
  <tr class="tr3">
    <td><img src="images/admin/cate.gif" align="absmiddle" /></td>
    <td>$value[cid]</td>
    <td>$value[cname]</td>
    <td>$value[module]</td>
    <td>&nbsp;
<!--
EOT;
if($this->catedb[$value[cid]][mid]!=0){print <<<EOT
-->
	<a href="$basename&up=$value[cid]">查看</a>
<!--
EOT;
}print <<<EOT
-->
	</td>
    <td>$value[total]</td>
    <td>$value[new]</td>
    <td>&nbsp;
<!--
EOT;
if($this->catedb[$value[cid]][mid]!=0){print <<<EOT
-->
	<a href="$basename&action=view&cid=$value[cid]">查看{$very[contentName]}</a>
<!--
EOT;
}if($this->catedb[$value[cid]][type]){
if($this->catedb[$value[cid]][mid]!=0){
print <<<EOT
-->
	 <a href="$admin_file?adminjob=category&action=publist&cid=$value[cid]">更新首页</a>
<!--
EOT;
}if($this->catedb[$value[cid]][mid]>0){
print <<<EOT
-->
	  <a href="$admin_file?adminjob=category&action=pubview&cid=$value[cid]">发布目录</a>
	  <a href="$admin_file?adminjob=category&action=pubupdate&cid=$value[cid]">更新目录</a>
<!--
EOT;
}}if($this->catedb[$value[cid]][mid]>0){print <<<EOT
-->
	  	 <a href="$admin_file?adminjob=edit&action=add&cid=$value[cid]">添加{$very[contentName]}</a></td>
  </tr>
<!--
EOT;
}}print <<<EOT
-->
</table>
</div>
<!--
EOT;
}elseif($action=='view'){
print <<<EOT
-->
<div class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="tr4">
    <td style="text-align:center">
	<form action="$basename" method="post"><!--
	类型: &nbsp;&nbsp;
      <select name="displaytype" id="displaytype">
        <option value="0" selected="selected">所有{$very[contentName]}</option>
        $selectString
      </select> -->
      &nbsp;&nbsp;每页数量:&nbsp;&nbsp;
      <input name="displaynum" type="text" class="trinput" id="displaynum" size="5" maxlength="3" value="$displaynum" />
      &nbsp;&nbsp;标题关键字搜索:&nbsp;&nbsp;
      <input name="keyword" type="text" class="trinput" id="keyword" size="10" value="$keyword" />&nbsp;
      <input name="cid" type="hidden" id="cid" value="$cid" />
      <input name="action" type="hidden" id="action" value="view" />
      &nbsp;
      <input type="submit" name="Submit2" value="显示" class="btn" />
	  </form>
	  <input type="button" value="添加新{$very[contentName]}" class="btn" onclick="window.location='$admin_file?adminjob=edit&action=add&cid=$cid';" /> <input type="button" name="Submit5" value="设置本目录" class="btn" onclick="window.location='$admin_file?adminjob=category&action=edit&action=edit&cid=$cid';"/>	  </td>
  </tr>
</table>

</div>
<form action="$basename" method="post" name="pub_edit" onsubmit="return checkAction();">
<div class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="head">
    <td colspan="8">
<!--
EOT;
if($mid>0){
print <<<EOT
-->
	<div style="float:right">{$very[contentName]}合计 {$total}，其中未发布的待审核{$very[contentName]} {$new} 条</div>
    <!--
EOT;
}print <<<EOT
-->
      {$cname} <a href="?adminjob=category&action=viewlist&cid=$cid" target="_blank"><img src="images/admin/listhome.png" alt="目录首页" width="16" height="16" hspace="5" border="0" align="absmiddle" /></a> <a href="rss.php?cid=$cid" target="_blank"><img src="images/admin/page_feed.png" alt="RSS" border="0" align="absmiddle" /></a> <a href="$admin_file?adminjob=category&action=edit&action=edit&cid=$cid"><img src="images/admin/cateset.png" alt="目录设置" hspace="5" border="0" align="absmiddle" /></a></td>
    </tr>
  <tr class="tr2">
    <td width="25">序号</td>
    <td>标题(文件数)</td>
    <td>发布者</td>
    <td>推荐</td>
    <td>使用次数</td>
    <td>状态</td>
    <td>添加时间</td>
    <td>操作</td>
  </tr>
<!--
EOT;
$i=0;
foreach($content as $value){
$value[title]=substrs($value[title],50);
$bgcolor = $i%2==0 ? 't_one' : 't_two';
if($value[url]==''){
$value[url]='javascript:void(0);';
}else{
$target=" target=\"_blank\"";
}
$imgadd = $value[photo] ? "<img src=\"images/admin/img.gif\" align=\"absmiddle\" alt=\"图文\" />" : '';
switch($value[ifpub]){
case 1:
$ifpub = '已发布';
break;
case 0:
$ifpub = '<font color=\'red\'>未发布</font>';
break;
case 2:
$ifpub = '待发布';
break;
default:
$ifpub = '未知';
break;
}
$value[postdate] = get_date($value[postdate],'m-d H:i');
$value[title] = strip_tags($value[title]);
print <<<EOT
-->
  <tr class="tr3 $bgcolor">
    <td><input name="tids[]" type="checkbox" id="tids[]" value="$value[tid]" />
      <!--$value[tid]--></td>
    <td><a href="$value[url]" $target>$value[title]</a>（$value[resnum]） $imgadd</td>
    <td>$value[publisher]<br /></td>
    <td>{$value[digest]}</td>
    <td>$value[hits]</td>
    <td>$ifpub</td>
    <td>$value[postdate]</td>
    <td> 
<a href="$admin_file?adminjob=edit&action=edit&cid=$cid&tid=$value[tid]"><img src="images/admin/edit.png" align="absmiddle" alt="编辑" /></a>
<a href="$basename&action=whole&cid=$cid&tid=$value[tid]&job=delete"><img src="images/admin/delete.png" align="absmiddle" alt="删除" onClick="return confirm('您确定要删除此{$very[contentName]}？');"/></a>
$value[digest_c]</td>
  </tr>
<!--
EOT;
}print <<<EOT
-->
</table>
</div>
<div class="t">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr class="tr4">
    <td>操作:
      <select name="job" id="job" onchange="showTarget(this.value);">
	  <option value="delete">删除{$very[contentName]}</option>
      <option value="move">移动{$very[contentName]}</option>
<!--      <option value="copy">复制{$very[contentName]}</option> -->
    <option value="pubview" selected="selected">审核发布</option>
      <option value="pubcancel">取消发布</option>
 <!--     <option value="pubupdate">更新发布</option>-->
    </select>
	<span id='target' style="display:none">
    目标:
      <select name="tocid" id="tocid">
        <option value="0" selected="selected">请选择</option>
	$cate_select
		</select>
	  </span>
      <input name="cid" type="hidden" id="cid" value="$cid" />
      <input name="action" type="hidden" id="action" value="whole" />
    <input type="button" name="Submit3" value="全选" class="btn" onclick="CheckAll(document.pub_edit);" />
    <input type="submit" name="Submit4" value="提交" class="btn" onclick="return whole(document.pub_edit);" /></td>
    <td style="text-align:right">$cms->page</td>
  </tr>
</table>
</div>
</form>
<style>
.st{ cursor:pointer;}
</style>
<script language="javascript" src="script/xhr.js"></script>
<script language="javascript">
function showTarget(id){
	var target = document.getElementById('target');
	if(id=='move' || id=='copy'){
		target.style.display='';
	}else{
	 	target.style.display='none';
	}
}
var okimg = 'images/admin/star_ok.gif';
var noimg = 'images/admin/star_no.gif';
var cid = '$cid';
var mid = '$mid';
var url = '$basename';
var current_key;
var current_tid;
var current_num;

var digestMsg = new Array(4);
digestMsg[0] = '您确认要取消此{$very[contentName]}的星级推荐吗？';
digestMsg[1] = '您确认要将此{$very[contentName]}设置为 一星级 吗？';
digestMsg[2] = '您确认要将此{$very[contentName]}设置为 二星级 吗？';
digestMsg[3] = '您确认要将此{$very[contentName]}作为 三星级 吗？';
function showStar(key,i){
	for(var s=1;s<=3;s++){
		var imgid = 'img'+key+'_'+s;
		if(s<=i){
		document.getElementById(imgid).src = okimg;
		}else{
		document.getElementById(imgid).src = noimg;
		}
	}
}

function reSet(key,num){
	for(var s=1;s<=3;s++){
		var imgid = 'img'+key+'_'+s;
		if(s<=num){
			document.getElementById(imgid).src = okimg;
		}else{
			document.getElementById(imgid).src = noimg;
		}
	}
}

function digest(id,key,num){
	var msg = confirm(digestMsg[num]);
	if(msg){
		current_num = num;
		current_tid = id;
		current_key = key;
		var x = new XHR('digestOk');
		x.get(url+'&action=digest&tid='+id+'&cid='+cid+'&mid='+mid+'&digestnum='+num);
	}else{
		return false;
	}
}

function digestOk(res){
	if(res=='100'){
		var divname = 'd_'+current_key;
		var divname2 = 'ss_'+current_key;
		document.getElementById(divname).innerHTML = "<div id='"+divname2+"' onmouseout=\"reSet('"+current_key+"','"+current_num+"')\"></div>";
		for(var i=1;i<=3;i++){
		if(i<=current_num){
			theimg = okimg;
		}else{
			theimg = noimg;
		}
		document.getElementById(divname2).innerHTML += "<img id='img"+current_key+"_"+i+"' class='st' src='"+theimg+"' onmouseover=\"showStar('"+current_key+"','"+i+"');\" onclick=\"digest('"+current_tid+"','"+current_key+"','"+i+"');\" />";
		}
	}
}

function checkAction()
{
	if(document.getElementById('job').value=='delete')
	{
		if (!confirm('您确认要删除这些{$very[contentName]}吗？')) return false;
	}
	return true;
}
</script>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
?>-->